﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PrattParsing
{
    [System.Diagnostics.DebuggerNonUserCode]
    public struct TextPos
    {
        public int pos; // absolute position in input string (index)
        public int line, col; // line #, col # (starting at 0)
        public int len; // length of token (in characters)

        public TextPos(int pos, int line, int col, int len)
        {
            this.pos = pos;
            this.line = line;
            this.col = col;
            this.len = len;
        }

        public override string ToString()
        {
            return "(line " + (line + 1) + ", col " + (col + 1) + ")";
        }
    }
}
